﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Supremacy.Tests
{
    /// <summary>
    /// A generic class that allows us to handle raised events of type <TKey/>, and return a list of all the events raised!
    /// Handler methods must be of the format object s, TKey e
    /// </summary>
    /// <typeparam name="TKey"></typeparam>
    class Listener<TKey>
    {
        #region Fields
        private readonly List<TKey> _args = new List<TKey>();
        #endregion

        #region Properties and Indexers
        public List<TKey> ReceivedEvents
        {
            get { return _args; }
        }
        #endregion

        #region Methods
        public void Listen(object s, TKey e)
        {
            _args.Add(e);
        }
        #endregion
    }
}
